// 更改密码成功时显示的对话框

// 关闭VSCode非必要报错
// ignore_for_file: camel_case_types, sized_box_for_whitespace

import 'package:flutter/material.dart';
import 'package:project_award_statistics/pages/mobile_material_design/login_page/login_page.dart';
import 'package:project_award_statistics/utils/mobile_material_design/my_button.dart';

class DialogChangePasswdSuccess_Mobile extends StatelessWidget {
  const DialogChangePasswdSuccess_Mobile({super.key});

  @override
  Widget build(BuildContext context) {
    return AlertDialog(
      backgroundColor: Theme.of(context).colorScheme.surface,
      content: SizedBox(
        height: 200,
        width: 180,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Text(
              "重置密码提示",
              style: TextStyle(
                fontSize: 20,
                fontWeight: FontWeight.bold,
              ),
            ),
            const SizedBox(height: 35,),
            Text(
              "恭喜,密码设置成功!",
              style: TextStyle(
                fontSize: 20,
              ),
            ),
            const SizedBox(height: 45,),
            SizedBox(
              height: 45,
              width: 170,
              child: MyButton(
                text: "好的,我现在回去登录", 
                onPressed: (){
                  Navigator.pushReplacement(
                    context, 
                    MaterialPageRoute(
                      builder: (context) => PopScope(
                        canPop: false,   // 设置页面禁止返回
                        child: LoginPage_Mobile(),
                      ),
                    ),
                  );  
                },
              ),
            ),
          ],
        ),
      ),
    );
  }
}